From 8895336d36bbd9b98a09628549485b22e826c71a Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:23:10 +0000 Subject: [PATCH] bitkeeper revision 1.1159.223.15 (41f2c43e5U8GurDCsAUaiGJ2VOmnUQ) Description: Use proper targets in makefiles A rule in make should produce only what it's target allows. When it produces side-effects, things like ctrl-c and parallellism break it oddly. From Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- xen/Makefile | 9 +++++---- xen/arch/x86/Makefile | 14 ++++++++++---- xen/common/Makefile | 3 ++- xen/drivers/acpi/Makefile | 3 ++- xen/drivers/char/Makefile | 3 ++- xen/drivers/pci/Makefile | 3 ++- 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 0c5c85e0f3..7eb1d17847 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -9,14 +9,15 @@ export BASEDIR := $(shell pwd) include Rules.mk -default: $(TARGET) - gzip -f -9 < $(TARGET) > $(TARGET).gz +default: $(TARGET).gz +$(TARGET).gz: $(TARGET) + gzip -f -9 < $< > $@.new + mv $@.new $@ debug: objdump -D -S $(TARGET)-syms > $(TARGET).s -install: $(TARGET) - gzip -f -9 < $(TARGET) > $(TARGET).gz +install: $(TARGET).gz mkdir -p $(prefix)/boot install -m0644 $(TARGET).gz $(prefix)/boot install -m0644 $(TARGET)-syms $(prefix)/boot diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 0062ce7678..574b0c35a5 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -12,12 +12,18 @@ OBJS += $(patsubst %.c,%.o,$(wildcard mtrr/*.c)) OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS)) -default: boot/$(TARGET_SUBARCH).o $(OBJS) boot/mkelf32 - $(LD) $(LDFLAGS) -r -o arch.o $(OBJS) - $(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \ - boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $(TARGET)-syms +default: $(TARGET) + +$(TARGET): $(TARGET)-syms boot/mkelf32 ./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 +$(CURDIR)/arch.o: $(OBJS) + $(LD) $(LDFLAGS) -r -o $@ $(OBJS) + +$(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(TARGET_SUBARCH)/xen.lds + $(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \ + boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $@ + asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(CC) $(CFLAGS) -S -o $@ $< diff --git a/xen/common/Makefile b/xen/common/Makefile index b764c1598a..1ae6148be2 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -21,7 +21,8 @@ ifneq ($(trace),y) OBJS := $(subst trace.o,,$(OBJS)) endif -default: $(OBJS) +default: common.o +common.o: $(OBJS) $(LD) $(LDFLAGS) -r -o common.o $(OBJS) clean: diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile index 2b80430148..fec92eb405 100644 --- a/xen/drivers/acpi/Makefile +++ b/xen/drivers/acpi/Makefile @@ -6,7 +6,8 @@ include $(BASEDIR)/Rules.mk OBJS := acpi_ksyms.o tables.o -default: $(OBJS) +default: driver.o +driver.o: $(OBJS) $(LD) $(LDFLAGS) -r -o driver.o $(OBJS) clean: diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile index f938f87017..957a4bc5a2 100644 --- a/xen/drivers/char/Makefile +++ b/xen/drivers/char/Makefile @@ -1,7 +1,8 @@ include $(BASEDIR)/Rules.mk -default: $(OBJS) +default: driver.o +driver.o: $(OBJS) $(LD) $(LDFLAGS) -r -o driver.o $(OBJS) clean: diff --git a/xen/drivers/pci/Makefile b/xen/drivers/pci/Makefile index 7fd6c1705f..040d5aaccd 100644 --- a/xen/drivers/pci/Makefile +++ b/xen/drivers/pci/Makefile @@ -28,7 +28,8 @@ OBJS := pci.o quirks.o compat.o names.o setup-res.o #obj-y += syscall.o #endif -default: $(OBJS) +default: driver.o +driver.o: $(OBJS) $(LD) $(LDFLAGS) -r -o driver.o $(OBJS) clean: -- 2.30.2